package org.zcl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zcl.entity.model.ApiResponse;
import org.zcl.entity.request.DateModelRequest;
import org.zcl.entity.response.DateModelResponse;
import org.zcl.service.DateService;

/**
 * @author zhuchenglin
 * @since 2024/2/5 17:56
 */
@RestController
@RequestMapping("/date")
public class DateController {

    @Autowired
    private DateService dateService;

    /**
     * 获取时间
     * @param dateModelRequest
     * @return
     */
    @RequestMapping("/getTime")
    public ApiResponse<DateModelResponse> getTime(@RequestBody DateModelRequest dateModelRequest) {
        return ApiResponse.<DateModelResponse>builder().data(dateService.getTime(dateModelRequest)).build();
    }
}
